<?php 


namespace app\index\controller;

use think\Controller;
use think\Db;
use think\Request;
use think\Cookie;

class Manpower extends Controller
{
    /**
     * [index 加载首页]
     */
    public function index()
    {
        $manpower = db('_recruitment_bulletin')
            ->where('status='.'1')
            ->select();

        $img = db('_recruitment_bulletin')->field(['image'])->select();
        //var_dump($img);die;
        //var_dump($manpower);die;
        return view('index@manpower/index',[
            'manpower' => $manpower,
            'img'      => $img,
            'loginname' => Cookie::get('loginname')
        ]);
    }


    /**
     * [detail 加载详情页]
     */
    public function detail()
    {
        $res = input('param.');
        $id = $res['id'];
        //var_dump($res);die;
        $manpower = db('_recruitment_bulletin')->find($id);
        //var_dump($manpower);die;
        return view('index@manpower/detail',[
            'manpower' => $manpower,
            'loginname' => Cookie::get('loginname')
        ]);
    }



    /**
     * [doadd 简历]
     */
    public function doadd()
    {
        $res = input('param.');
        //var_dump($res);die;

        $res['status'] = 0;
        
        
        
        //$res['date'] = date("Y-m-d H:i:s",time());
        //var_dump($res);die;
        $result = db('_employee_information')
                  ->insert($res);
        //var_dump($result);die;
        
        //var_dump($manpower);
    }

    public function _empty(Request $request)
    {
        return view('/error');
    }




}

